In video processing, transmitted video is almost always represented in a three-dimensional color space. Video may be represented in the YCrCb, where Y is the luminance or brightness component and Cr and Cb are the chrominance or color components. Video may also be represented in the RGB color space, where R is the red color component, G is the green color component, and B is the blue color component. While most video processing applications are in YCrCb space, most televisions displays utilize the RGB color space. Thus, when a television receives a transmission that in the YCrCb space, a conversion may take place to the RGB space. However, the YCrCb color space is larger than the RGB color space. If the YCrCb and the RGB color spaces were to be represented by cubes, the RGB cube would be entirely inside the YCrCb cube. Colors that are in the YCrCb color space, but that are outside the RGB color space are referred to as “out-of-gamut” and are not valid colors to the human eye. Conventional video processing can lead to generating colors that are out-of-gamut. One way of resolving this issue and transforming an out-of-gamut color space to an in-gamut color space is by “clipping” the out-of-gamut colors that are out of the RGB color space.
FIG. 1 illustrates a block diagram of a projection of a valid RGB cube to a (Cr, Y) plane. For a given Y value, many Cr values are out-of-gamut. Also, Y values in the range [0,16] or [235,255] have Cr=0, and in the YCrCb color space, pixels with a Y value above 235 appear white, and pixels with a Y value below 16 appear black. If a pixel outside the RGB gamut is converted to RGB with a standard matrix conversion, values will exceed the legal RGB ranges of [0,255]. As an example, an out-of-gamut value of YCrCb =[16, 0, 0] converts to RGB=[neg, 154, neg]. If the negative values are simply clipped to zero, the resulting color is bright green. But (Y==16) should result in black. The problem in converting from the YCrCb color space to the RGB color space is that a color that is represented by YCrCb may not fall within the RGB cube, and a decision needs to be made on what the television is supposed to display using RGB representation.
After converting YCrCb =[16, 0, 0] to RGB=[neg, 154, neg], the negative values may be easily clipped. However, the positive green value has substantially increased. Clipping the negative values, therefore, may not preserve luminance and may instead add positive luminance to the output. Thus, a pixel with a luminance of 16, which may have a color very close to black, when clipped to the RGB cube, ends up much brighter than it should be. Similarly, pixels in the region outside the RGB cube and above the line where the luminance is 235 should be white, but with clipping them to the RGB cube, the pixels end up with a color instead of being white, is an off-white color. The white pixels may become a little green or red or gray, but not white. Clipping causes noticeable artifacts around objects on the TV screen, especially, around the black and the white regions where other colors leak in.
Clipping may work moderately when the clipping produces a small error. However, clipping causes problems when large errors result such as, for example, when a pixel falls in the black and white regions, where Y values are below 16 and above 235, respectively. Because many video devices output YCrCb signals directly, a method is desired to keep the YCrCb values in a legal range, without the complexity of converting to the RGB space, clipping, and then converting back to YCrCb. In addition, simply “clipping” the out-of-gamut values back to the RGB space is acceptable for small excursions, but it can cause visible distortion for signals that are far out-of-gamut. The eye is most sensitive to luminance than hue, and least sensitive to saturation. As a result, it is most favorable to preserve luminance, and sacrifice saturation.
Although it is possible to accurately limit saturation to a color space, mathematically precise methods involve coordinate transforms that can be prohibitively expensive for low-cost applications. Because small excursions and small changes to hue are not objectionable, it is desirable to have an approximate solution with reasonable quality at a low cost.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.